﻿using System.Configuration;

namespace Altairis.MailToolkit.Configuration {

    public class MailToolkitConfigurationSection : ConfigurationSection {

        /// <summary>
        /// Gets or sets the template resource configuration.
        /// </summary>
        /// <value>The template resource configuration.</value>
        [ConfigurationProperty("templateResource", IsRequired = true)]
        public TemplateResourceElement TemplateResource {
            get { return (TemplateResourceElement)this["templateResource"]; }
            set { this["templateResource"] = value; }
        }

        /// <summary>
        /// Gets or sets the from address configuration.
        /// </summary>
        /// <value>The from address configuration.</value>
        [ConfigurationProperty("from", IsRequired = true)]
        public EmailAddressElement From {
            get { return (EmailAddressElement)this["from"]; }
            set { this["from"] = value; }
        }

        /// <summary>
        /// Gets or sets the sender address configuration.
        /// </summary>
        /// <value>The sender address configuration.</value>
        [ConfigurationProperty("sender", IsRequired = false)]
        public EmailAddressElement Sender {
            get { return (EmailAddressElement)this["sender"]; }
            set { this["sender"] = value; }
        }

        /// <summary>
        /// Gets or sets the reply-to address configuration.
        /// </summary>
        /// <value>The reply-to address configuration.</value>
        [ConfigurationProperty("replyTo", IsRequired = false)]
        public EmailAddressElement ReplyTo {
            get { return (EmailAddressElement)this["replyTo"]; }
            set { this["replyTo"] = value; }
        }

        /// <summary>
        /// Gets or sets the encoding configuration.
        /// </summary>
        /// <value>The encoding configuration.</value>
        [ConfigurationProperty("encoding", IsRequired = false)]
        public EncodingElement Encoding {
            get { return (EncodingElement)this["encoding"]; }
            set { this["encoding"] = value; }
        }

        [ConfigurationProperty("listManager", IsRequired = false)]
        public ListManagerElement ListManager {
            get { return (ListManagerElement)this["listManager"]; }
            set { this["listManager"] = value; }
        }

        [ConfigurationProperty("transport", IsRequired = false)]
        public TransportElement Transport {
            get { return (TransportElement)this["transport"]; }
            set { this["transport"] = value; }
        }

        [ConfigurationProperty("headers", IsRequired = false)]
        public HeadersElement Headers {
            get { return (HeadersElement)this["headers"]; }
            set { this["headers"] = value; }
        }
    }
}